export default {
	data() {
		return {}
	},
	methods: {
		navTo(url, options = {}) {
			uni.navigateTo({
				url
			})
		},
		tabTo(url, options = {}) {
			uni.switchTab({
				url
			})
		},
		showLoading(type) {
			let title = '加载中..'
			if (type == 1) {
				uni.showLoading({
					title: title,
					mask: true,
				});
			}
		},
		hideLoading(time = 2000) {
			setTimeout(function() {
				uni.hideLoading();
			}, time);
		},
		showMsg(title = '', param = {}) {
			if (!title) return;
			uni.showToast({
				title,
				duration: param.duration || 1500,
				mask: param.mask || false,
				icon: param.icon || 'none'
			});
		},


	},
}